package com.zmn.oms.services.impl.conf.attachment;

import com.google.common.collect.Lists;
import com.zmn.oms.model.entity.conf.attachment.WorkOrderPictureStandard;
import com.zmn.oms.persistence.interfaces.conf.attachment.WorkOrderPictureStandardDao;
import com.zmn.oms.services.interfaces.conf.attachment.WorkOrderPictureStandardService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author sunlife
 * @since :2021/10/29 4:41 下午
 * description:
 */
@Service
public class WorkOrderPictureStandardServiceImpl implements WorkOrderPictureStandardService {

    @Resource
    com.zmn.oms.persistence.interfaces.conf.attachment.WorkOrderPictureStandardDao WorkOrderPictureStandardDao;

    @Override
    public WorkOrderPictureStandard findByKey(Integer id) {
        return WorkOrderPictureStandardDao.selectByPrimaryKey(id);
    }

    @Override
    public List<WorkOrderPictureStandard> listStandardByRelateId(Integer relateId) {
        return WorkOrderPictureStandardDao.listStandardByRelateId(Lists.newArrayList(relateId));
    }

    @Override
    public List<WorkOrderPictureStandard> listStandardByRelateIds(List<Integer> relateIds) {
        return WorkOrderPictureStandardDao.listStandardByRelateId(relateIds);
    }

    @Override
    public int insert(WorkOrderPictureStandard standard) {
        return WorkOrderPictureStandardDao.insert(standard);
    }

    @Override
    public int batchInsert(List<WorkOrderPictureStandard> standardList) {
        return WorkOrderPictureStandardDao.batchInsert(standardList);
    }

    @Override
    public int delete(WorkOrderPictureStandard standard) {
        return WorkOrderPictureStandardDao.deleteByQuery(standard);
    }
}
